package com.py.payment.service.impl;

import com.py.payment.dto.ret.PlanRecordsRetDto;
import com.py.payment.entity.PlanRecords;
import com.py.payment.mapper.PlanRecordsMapper;
import com.py.payment.service.PlanRecordsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.py.payment.tools.date.DateUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 预案记录 服务实现类
 * </p>
 *
 * @author py
 * @since 2024-05-21
 */
@Service
public class PlanRecordsServiceImpl extends ServiceImpl<PlanRecordsMapper, PlanRecords> implements PlanRecordsService {

    @Override
    public List<PlanRecordsRetDto> getPlanRecords(PlanRecords planRecords) {
        List<PlanRecordsRetDto> planRecordsRetDtoList = this.baseMapper.getPlanRecords(planRecords);
        planRecordsRetDtoList.forEach(item->{
            item.setCreateTimeStr(DateUtils.dateToDateStr(item.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
        });
        return planRecordsRetDtoList;
    }
}


